import request from '@/router/axios'
import store from "@/store";

/*
* 自动拉群管理列表
* */
export function getWorkRoomAutoPull(query) {
    return request({
        url: '/cp/workroomautopull/page',
        method: 'get',
        params: query
    })
}

/*
* 新建自动拉群
* */
export function postWorkRoomAutoPull(obj) {
    return request({
        url: '/cp/workroomautopull',
        method: 'post',
        data: obj
    })
}

/*
* 修改自动拉群
* */
export function putWorkRoomAutoPull(obj) {
    return request({
        url: '/cp/workroomautopull',
        method: 'put',
        data: obj
    })
}

/*
* 自动拉群详情
* */
export function getDetails(id) {
    return request({
        url: '/cp/workroomautopull/' + id,
        method: 'get',
    })
}
/*
* 自动拉群删除
* */
export function delWorkRoomAutoPull(id) {
    return request({
        url: '/cp/workroomautopull',
        method: 'delete',
        params: { id }
    })
}

/*
* 群聊列表下拉框
* */
export function getWorkRoom(query) {
    return request({
        url: '/cp/workroom/roomindex',
        method: 'get',
        params: query
    })
}

/*
* 获取标签组列表
* */
export function getCustomerLabelList(query) {
    return request({
        url: '/cp/workcontacttaggroup',
        method: 'get',
        params: query
    })
}

/*
*
创建标签
* */
export function postTagList(obj) {
    return request({
        url: '/cp/workcontacttag',
        method: 'post',
        data: obj
    })
}

// 上传
export function sysFileUpload(obj) {
    return request({
        url: '/admin/sys-file/upload',
        method: 'post',
        // responseType: 'blob',
        data: obj,
        headers: {
            Authorization: "Bearer " + store.getters.access_token,
            LdapToken: store.getters.ldap_token,
            "content-type": "multipart/form-data"
        },
    })
}